﻿@using Orchard.Azure.MediaServices.Models
@using Orchard.Azure.MediaServices.Models.Assets
@using Orchard.ContentManagement
@{
    var videoPart = (CloudVideoPart)Model.ContentPart;
    var activeJobCount = (int)Model.ActiveJobCount;
}
<div class="upload-status-wrapper"
     data-status-url="@Url.Action("State", "Asset", new { id = videoPart.MezzanineAsset.Record.Id, area = "Orchard.Azure.MediaServices" })"
     data-upload-status="@videoPart.MezzanineAsset.UploadState.Status"
     data-published="@videoPart.IsPublished().ToString().ToLower()"
     data-video-id="@videoPart.Id"
     data-published-text="@T("Published")"
     data-draft-text="@T("Draft")">
    <div class="upload-status">
        <em>@T("Upload Status:")</em>
        <span class="upload-status-text">@videoPart.MezzanineAsset.UploadState.Status</span>
    </div>
    <div class="upload-progress-status" @if (videoPart.MezzanineAsset.UploadState.Status != AssetUploadStatus.Uploading) { <text> style="display:none;" </text>  }>
        <em>@T("Upload Progress:")</em>
        <span class="upload-progress-value">@T("{0}%", (int)(videoPart.MezzanineAsset.UploadState.PercentComplete.GetValueOrDefault()))</span>
    </div>
    <script src="~/Modules/Orchard.Azure.MediaServices/Scripts/cloudmedia-metadata-cloudvideopart.js"></script>
</div>
@if (activeJobCount > 0) {
    <div>
        <em>@T("Active Jobs:")</em>
        <span>@activeJobCount</span>
    </div>
}